You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've written some code for automatically dealing with glade interfaces in D. Essentially it parses the glade interfaces(manually, so it is fragile) and builds a D class that corresponds to the elements in the interface and automatically handles much of the boilerplate code:
This, when set up properly, will display the the interface. One can access the glade interface elements directly in D from the class MainAppContext by their name in the glade interface.
e.g.,
MainAppContext.label
One can also use the @ symbol in the id to replace it with the root GtkWindow, GtkApplicationWindow, GtkDialog id(to shorten writing names in glade). ! will be replaced with the type.
e.g., an id of @Label under a GTKWindow named MyWindow would become
MainAppContext.MyWindow.MyWindowlabel
The text was updated successfully, but these errors were encountered:
Sell, that is your job! ;) It's going to be fragile parsing the code the way it does. Not really worth writing a full blown grammar parser for it. The other code might be a little hacky but it does work.
Since glade isn't changing much the code should work in for good enough for most people and since it provides big reduction in boiler plating it's probably worth it... but you are welcome to take the idea and write something better. I haven't had a huge issue with it though, in fact, I don't think I've had it fail once, although I have not stressed much either.
It's better to have it around for people to use and then if it fails to scrap it and go to manual mode then only have manual mode as an option.
I've written some code for automatically dealing with glade interfaces in D. Essentially it parses the glade interfaces(manually, so it is fragile) and builds a D class that corresponds to the elements in the interface and automatically handles much of the boilerplate code:
https://ufile.io/8znx4
http://www.filedropper.com/interfacegladetest
module InterfaceGladeTest;
import mGtkD_All;
class cMainAppContext : GtkBase!("test.glade")
} __gshared cMainAppContext MainAppContext = new cMainAppContext();
int main(string[] args)
{
MainAppContext = New!cMainAppContext();
}
This, when set up properly, will display the the interface. One can access the glade interface elements directly in D from the class MainAppContext by their name in the glade interface.
e.g.,
MainAppContext.label
One can also use the @ symbol in the id to replace it with the root GtkWindow, GtkApplicationWindow, GtkDialog id(to shorten writing names in glade). ! will be replaced with the type.
e.g., an id of @Label under a GTKWindow named MyWindow would become
MainAppContext.MyWindow.MyWindowlabel
The text was updated successfully, but these errors were encountered: